package shogi;

import shogi.pieces.Piece;

/**
 *
 * @author Charles Ritchea
 * @author Cody Kraatz
 */
public class ShogiController {

    private ShogiControllerProduct shogiControllerProduct = new ShogiControllerProduct();
    private int[] rightPlacement;

    public ShogiController() {
        shogiControllerProduct.setLeftPlacement(new int[81]);
        rightPlacement = new int[81];
        shogiControllerProduct.setLegalBishop(false);
    }

    public boolean isStopBishop() {
        return shogiControllerProduct.getLegalBishop();
    }

    public void setStopBishop(boolean stopBishop) {
        shogiControllerProduct.setLegalBishop(stopBishop);
    }

    public int getLeftPlacement(int i) {
        return shogiControllerProduct.getLeftPlacement(i);
    }

    public void setLeftPlacement(int i, int value) {
        shogiControllerProduct.setLeftPlacement(i, value);
    }

    public int getRightPlacement(int i) {
        return rightPlacement[i];
    }

    public void setRightPlacement(int i, int value) {
        this.rightPlacement[i] = value;
    }

    public boolean isLegal(int originalIndex, int destinationIndex, Piece aShogiPiece) {
        return shogiControllerProduct.isLegal(originalIndex, destinationIndex,
                aShogiPiece, this);
    }
}
